﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestMatrix.Model
{
    public class tblNumOfExecutedTC : INotifyPropertyChanged, INotifyPropertyChanging
    {
        public tblNumOfExecutedTC()
        {
           
        }

        public tblNumOfExecutedTC(
            int id
            , string application
            , string executedStartDt
            , int numExecutedTC
            , int numPassed
            , int numFailed
            )
        {
            this.ID = id;
            this.Application = application;
            this.ExecutedStartDt = executedStartDt;
            this.NumExecutedTC = numExecutedTC;
            this.NumPassed = numPassed;
            this.NumFailed = numFailed;
        }

        private int _ID;

        public int ID
        {
            get { return _ID; }
            set
            {
                if (_ID != value)
                {
                    NotifyPropertyChanging("ID");
                    _ID = value;
                    NotifyPropertyChanged("ID");
                }
            }

        }
        
        private string _Application;

        public string Application
        {
            get { return _Application; }
            set
            {
                if (_Application != value)
                {
                    NotifyPropertyChanging("Application");
                    _Application = value;
                    NotifyPropertyChanged("Application");
                }
            }
        }

        private string _ExecutedStartDt;

        public string ExecutedStartDt
        {
            get { return _ExecutedStartDt; }
            set
            {
                if (_ExecutedStartDt != value)
                {
                    NotifyPropertyChanging("ExecutedStartDt");
                    _ExecutedStartDt = value;
                    NotifyPropertyChanged("ExecutedStartDt");
                }
            }
        }

        private int _NumExecutedTC;

        public int NumExecutedTC
        {
            get { return _NumExecutedTC; }
            set
            {
                if (_NumExecutedTC != value)
                {
                    NotifyPropertyChanging("NumExecutedTC");
                    _NumExecutedTC = value;
                    NotifyPropertyChanged("NumExecutedTC");
                }
            }

        }

        private int _NumPassed;

        public int NumPassed
        {
            get { return _NumPassed; }
            set
            {
                if (_NumPassed != value)
                {
                    NotifyPropertyChanging("NumPassed");
                    _NumPassed = value;
                    NotifyPropertyChanged("NumPassed");
                }
            }

        }

        private int _NumFailed;

        public int NumFailed
        {
            get { return _NumFailed; }
            set
            {
                if (_NumFailed != value)
                {
                    NotifyPropertyChanging("NumFailed");
                    _NumFailed = value;
                    NotifyPropertyChanged("NumFailed");
                }
            }

        }

        public event PropertyChangedEventHandler PropertyChanged;

        // Used to notify that a property changed
        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        // Used to notify that a property is about to change
        private void NotifyPropertyChanging(string propertyName)
        {
            if (PropertyChanging != null)
            {
                PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
            }

        }
    }
}
